home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / LaserWriterIIsc (New GX v1.1) / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1996-06-15  |  7.0 KB  |  270 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2. FILENAME
  3.     ChooserSupport.r
  4.  
  5. DESCRIPTION
  6.     This module contains the LaserWriter SC constants, types, and resources that
  7.     are needed in order for the driver to work with the Chooser.
  8.             
  9.     Note: all resources should be designated to load into the system heap.
  10.  
  11. COPYRIGHT
  12.      Copyright Apple Computer, Inc. 1992 - 1996
  13.      All rights reserved. 
  14.  
  15. MODIFICATION HISTORY
  16.      6/14/96 - cn  - Updated to support Universal Interfaces 2.1.
  17.     
  18. -------------------------------------------------------------------------------- */
  19.  
  20. // System 7.0 Compatible
  21. #define SystemSevenOrLater        1
  22.  
  23. // Include System Resource Definitions
  24. #include "Types.r"
  25. #include "SysTypes.r"
  26.  
  27. // Include the LaserWriter SC driver constants that are used in the resources 
  28. #include "LaserSCResources.h"
  29.  
  30. // Include the public QuickDraw GX printing files 
  31. #include "GXPrintingResTypes.r"
  32.  
  33. // Include the LaserWriterSC Driver's LDEF and PACK Code Segments ===== */
  34.  
  35. include "LWSC_PACK";
  36. include "LWSC_LDEF";
  37.  
  38.  
  39. /*********************************************************************************************
  40.      THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  41. *********************************************************************************************/
  42.  
  43. // The 'look' resource is used by the driver's PACK to know how to communicate 
  44. // to the device.  This resource contains the default settings, as the actual value 
  45. // can be found in the desktop printer. 
  46.  
  47. resource 'look' (kLookRsrcID, sysheap) 
  48. {
  49.     1,                                    // use the first in our list by default
  50.     {
  51.         "SCSI",            kSCSICommRsrcID,                iconCells,                                "";
  52.         "Servers",        kPrinterShareCommRsrcID,    isAppleTalk+isPrinterShare,        "LaserWriterSCIS";
  53.     };
  54. };
  55.  
  56.  
  57. // This 'comm' resource defines the default communication settings when using this 
  58. // driver with PrinterShare. 
  59.  
  60. resource 'comm' (kPrinterShareCommRsrcID)
  61. {
  62.     PrinterShare
  63.     {
  64.         "",
  65.         0
  66.     };
  67. };
  68.  
  69.  
  70. // This 'comm' resource defines the default communication settings when using this 
  71. // driver with direct SCSI communications. 
  72.  
  73. resource 'comm' (kSCSICommRsrcID)
  74. {
  75.     SCSI
  76.     {
  77.         0,                                        // release device routine 
  78.         0,                                        // io attibutes 
  79.         0,                                        // status byte 
  80.         0,                                        // scsi bus number 
  81.         0,                                        // scsi ID 
  82.         0,                                        // chunk level 
  83.         0,                                        // acquire routine (use default)  
  84.         2,                                        // deviceType to look for 
  85.         27,                                    // minimum length of additional response data 
  86.         8,                                        // bytes from start for search 
  87.         "APPLE   PERSONAL LASER  ",    // search string 
  88.     };
  89. };
  90.     
  91.  
  92. /*********************************************************************************************
  93.     STANDARD CHOOSER PACK STUFF
  94. *********************************************************************************************/
  95.  
  96. // NBP Lookup type (maxed out so resource file won't need updating)
  97. resource 'STR ' (-4096)
  98. {
  99.     "XXXXXXXXXXXXXXXXXXXXXX";
  100. };
  101.  
  102. // NBP timeout value
  103. type 'GNRL'
  104. {
  105.     byte;    // timeout
  106.     byte;    // retries
  107. };
  108.  
  109. resource 'GNRL' (-4096)
  110. {
  111.     11,
  112.     5
  113. };
  114.  
  115. // title string (we'll put a control here, so we don't want a title)
  116. resource 'STR ' (-4091)
  117. {
  118.     "";
  119. };
  120.  
  121. // "left" button title
  122. resource 'STR ' (-4093)
  123. {
  124.     "Create";
  125. };
  126.  
  127. // rectangle list
  128. resource 'nrct' (-4096) {
  129.     {
  130.     {112, 251, 132, 311};            // left button
  131.     {0,0,0,0};                            // right button
  132.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  133.     {0,0,0,0};                            // off button
  134.     {0,0,0,0};                            // button label
  135.     };
  136. };
  137.  
  138. // Menu used to select between direct connect, AppleTalk, and Servers
  139. resource 'MENU' (-4096)
  140. {
  141.     -4096,
  142.     textMenuProc,
  143.     0xFFFFFFFF,    
  144.     enabled,
  145.     "",
  146.     {
  147.     }
  148. };
  149.  
  150. // Pop-up control used to select between direct connect printers and those being shared on the network
  151. resource 'CNTL' (-4096, purgeable)
  152. {
  153.     {0, 0, 20, 213},                            // zero based control location
  154.     0,                                                // Title options 0 = Left justified
  155.     visible,                                        // Should we display the control?
  156.     95,                                            // Title Width
  157.     -4096,                                        // 'MENU' to display
  158.     popupMenuCDEFproc+popupFixedWidth,    // CDEF = CDEFID * 16 + varCode
  159.     0,                                             // refCon = ResType to append = None
  160.     "Connect via:"                                // Control title
  161. };
  162.  
  163. resource 'DITL' (-4096) 
  164. {
  165.     {
  166.         {3, 238, 23, 238 + 213}, 
  167.             Control {enabled, -4096},
  168.     };
  169. };
  170.  
  171.  
  172. resource 'DITL' (-4095) {
  173.     {    /* array DITLarray: 2 elements */
  174.         /* [1] */
  175.         {143, 310, 163, 368},
  176.         Button {
  177.             enabled,
  178.             "OK"
  179.         },
  180.         /* [2] */
  181.         {23, 87, 119, 377},
  182.         StaticText {
  183.             disabled,
  184.             "This printer driver could not be used.\n\n"
  185.             "Quitting one or more applications and then "
  186.             "trying again may allow you to use this "
  187.             "printer driver."
  188.         }
  189.     }
  190. };
  191.  
  192. resource 'ALRT' (-4095) {
  193.     {30, 30, 30+175, 30+380},
  194.     -4095,
  195.     {    /* array: 4 elements */
  196.         /* [1] */
  197.         OK, visible, sound1,
  198.         /* [2] */
  199.         OK, visible, sound1,
  200.         /* [3] */
  201.         OK, visible, sound1,
  202.         /* [4] */
  203.         OK, visible, sound1
  204.     },
  205.     alertPositionParentWindowScreen
  206. };
  207.  
  208. //-----------------------------------------------------------------------------------
  209. // CHOOSER PACK HELP RESOURCES
  210. //-----------------------------------------------------------------------------------
  211.  
  212.  
  213. /*    Any Chooser package can get balloons on all items that are normally 
  214.     added to the Chooser dialog by containing a STR# resource of 
  215.     resource ID = PackResID (-5694) and following the convention below:
  216.         
  217.         resource 'STR#' (-5694, purgeable) {
  218.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  219.                 "kDisabledLeftButton";    // message for the control that is Disabled
  220.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  221.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  222.                 "kEnabledRightButton";
  223.                 "kDisabledRightButton";
  224.                 "kCheckedRightButton";
  225.                 "kOtherRightButton";
  226.                 "kEnabledOnButton";
  227.                 "kDisabledOnButton";
  228.                 "kCheckedOnButton";
  229.                 "kOtherOnButton";
  230.                 "kEnabledOffButton";
  231.                 "kDisabledOffButton";
  232.                 "kCheckedOffButton";
  233.                 "kOtherOffButton";
  234.                 "kEnabledOnOffTitle";
  235.                 "kDisabledOnOffTitle";
  236.                 "kCheckedOnOffTitle";
  237.                 "kOtherOnOffTitle";
  238.           }
  239.         };
  240.         
  241.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  242. */
  243.  
  244. resource 'STR#' (-5694, purgeable) {
  245.   {        
  246.   
  247.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  248.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  249.         "";    // message for the control that is Checked (ie CtrlValue>0)
  250.         "";    // message for the control that is Other (ie CtrlValue>1)
  251.         "";    // kEnabledRightButton
  252.         "";    // kDisabledRightButton
  253.         "";    // kCheckedRightButton
  254.         "";    // kOtherRightButton
  255.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  256.         "";    // kDisabledOnButton
  257.         "";    // kCheckedOnButton 
  258.         "";    // kOtherOnButton
  259.         "";    // kEnabledOffButton
  260.         "";    // kDisabledOffButton
  261.         "";    // kCheckedOffButton
  262.         "";    // kOtherOffButton
  263.         "";    // kEnabledOnOffTitle
  264.         "";    // kDisabledOnOffTitle
  265.         "";    // kCheckedOnOffTitle
  266.         "";    // kOtherOnOffTitle
  267.   }
  268. };
  269.  
  270.